<div
  v-loading="isPageLoading"
  :class="[$store.state.appPrefix + '-p-edit-period', 'g-edit-layout', $store.state.appPrefix + '-p-period-comon']">
  <div class="info-header">
    <i class="el-icon-arrow-left" @click="$router.go(-1)"></i>
    {{isEdit ? '编辑课时' : '创建课时'}}
  </div>
  <div class="edit-period-content">
    <el-form
      class="con-inner is-normal"
      label-suffix="："
      label-width="120px"
      ref="basicForm"
      :disabled="isDetail"
      :rules="rules"
      :model="basicForm">
      <el-form-item label="课时名称" prop="lessonName">
        <el-input size="small" placeholder="请输入" v-model="basicForm.lessonName" />
      </el-form-item>
      <el-form-item class="form-salesLanguage" label="销售话术" prop="salesLanguage">
        <el-radio size="small" v-model="basicForm.salesMethods" label="1">FABE</el-radio>
        <el-button class="salesLanguage-example" size="small" type="text" @click="exampleVisible = true">话术示例</el-button>
        <div class="practice-con">
          <div v-for="(it, k) in PRACTICE_LIST" :key="k" class="con-it">
            <div class="practice-title">{{it.title}}</div>
            <div class="practice-content">
              <el-input
                size="small"
                type="textarea"
                :rows="4"
                placeholder="请输入内容"
                resize="none"
                v-model="basicForm.salesLanguage[it.params]">
              </el-input>
            </div>
          </div>
        </div>
      </el-form-item>
      <el-form-item label="关键词" prop="keywords">
        <el-input
          size="small"
          type="textarea"
          :rows="4"
          placeholder="多个关键词使用、隔开，如：安全保障、合同条款、即时赔付"
          resize="none"
          v-model="basicForm.keywords">
        </el-input>
      </el-form-item>
      <el-form-item label="练习项目" prop="practiceProject">
        <el-checkbox-group 
          v-if="userInfo.funIds && userInfo.funIds.split(',').length > 0"
          v-model="basicForm.practiceProject">
          <el-checkbox v-for="it in userInfo.funIds.split(',')" v-if="FUN_IDS_OPTIONS[it]"  :label="it" :key="k" :disabled="FUN_IDS_OPTIONS[it].isDeveloping">{{FUN_IDS_OPTIONS[it].codeName}} {{FUN_IDS_OPTIONS[it].isDeveloping ? '(开发中)' : ''}}</el-checkbox>
        </el-checkbox-group>
        <div v-else class="desc">暂无可选练习项目</div>
      </el-form-item>
      <el-form-item label="通关及格分" prop="passingScore">
        <span class="desc" v-if="!basicForm.practiceProject || basicForm.practiceProject.length <= 0">
          请先选择练习项目
        </span>
        <el-input v-else class="ipt-score" size="small" placeholder="请输入内容" v-model="basicForm.passingScore" @input="handleInput">
          <template slot="prepend">话术跟读</template>
          <template slot="append">分</template>
        </el-input>
      </el-form-item>
    </el-form>
  </div>
  <div class="action-box">
    <el-button size="small" @click="$router.go(-1)">返回</el-button>
    <el-button size="small" v-if="!isDetail" @click="$saveForm" type="primary">保存</el-button>
  </div>
  <example-dialog :exampleVisible.sync="exampleVisible"></example-dialog>
</div>
